package repeat.personal.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 正则工具类
 * @author: Zhanggq
 * @date: 2019/6/18 11:45
 **/
public class RegExUtil {

    /**
     * 判断一个字符串是否为整型数字
     * @param string
     * @return
     */
    public static boolean isInt(String string) {
        if (string == null){
            return false;
        }
        String regEx1 = "[\\-|\\+]?\\d+";
        Pattern p;
        Matcher m;
        p = Pattern.compile(regEx1);
        m = p.matcher(string);
        if (m.matches()){
            return true;
        }else{
            return false;
        }

    }

}
